import 'package:ls_work/util/ext_utils.dart';
import 'package:ls_work/viewmodel/device/device_repair_building_view_model.dart';

/// buildingNo : "苏宁睿城"
/// floors : 4
/// rooms : 82
/// orderNum : 1
/// branchId : 1613
/// tenantId : 1000
/// saasId : 1000
/// flag : 1
/// id : 15
/// createdBy : "5"
/// createdDate : "2020-01-17 11:31:21"
/// updatedBy : "4550"
/// updatedDate : "2021-09-26 10:40:39"

class BuildingListData implements IBuildingModel{
  BuildingListData({
      String? buildingNo,
      int? floors,
      int? rooms,
      int? orderNum,
      int? branchId,
      int? tenantId,
      int? saasId,
      int? flag,
      int? id,
      String? createdBy,
      String? createdDate,
      String? updatedBy,
      String? updatedDate,}){
    _buildingNo = buildingNo;
    _floors = floors;
    _rooms = rooms;
    _orderNum = orderNum;
    _branchId = branchId;
    _tenantId = tenantId;
    _saasId = saasId;
    _flag = flag;
    _id = id;
    _createdBy = createdBy;
    _createdDate = createdDate;
    _updatedBy = updatedBy;
    _updatedDate = updatedDate;
}

  BuildingListData.fromJson(dynamic json) {
    _buildingNo = json['buildingNo'];
    _floors = json['floors'];
    _rooms = json['rooms'];
    _orderNum = json['orderNum'];
    _branchId = json['branchId'];
    _tenantId = json['tenantId'];
    _saasId = json['saasId'];
    _flag = json['flag'];
    _id = json['id'];
    _createdBy = json['createdBy'];
    _createdDate = json['createdDate'];
    _updatedBy = json['updatedBy'];
    _updatedDate = json['updatedDate'];
  }
  String? _buildingNo;
  int? _floors;
  int? _rooms;
  int? _orderNum;
  int? _branchId;
  int? _tenantId;
  int? _saasId;
  int? _flag;
  int? _id;
  String? _createdBy;
  String? _createdDate;
  String? _updatedBy;
  String? _updatedDate;

  String? get buildingNo => _buildingNo;
  int? get floors => _floors;
  int? get rooms => _rooms;
  int? get orderNum => _orderNum;
  int? get branchId => _branchId;
  int? get tenantId => _tenantId;
  int? get saasId => _saasId;
  int? get flag => _flag;
  int? get id => _id;
  String? get createdBy => _createdBy;
  String? get createdDate => _createdDate;
  String? get updatedBy => _updatedBy;
  String? get updatedDate => _updatedDate;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['buildingNo'] = _buildingNo;
    map['floors'] = _floors;
    map['rooms'] = _rooms;
    map['orderNum'] = _orderNum;
    map['branchId'] = _branchId;
    map['tenantId'] = _tenantId;
    map['saasId'] = _saasId;
    map['flag'] = _flag;
    map['id'] = _id;
    map['createdBy'] = _createdBy;
    map['createdDate'] = _createdDate;
    map['updatedBy'] = _updatedBy;
    map['updatedDate'] = _updatedDate;
    return map;
  }

  @override
  String get iBuildingId => id.toStringOrNull()??"";

  @override
  String get iBuildingName => buildingNo??"";

}